package com.ttbj.product.bean.dto;

import java.io.Serializable;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.ttbj.constant.GenerateNumConstants;
import com.ttbj.util.DateUtils;
import com.ttbj.util.TokenUtils;

import lombok.NonNull;


@JsonInclude(Include.NON_NULL)
public class OwnerDto implements Serializable {

 
	private static final long serialVersionUID = -2186684500571677537L;
	private Long ownerId;

    private String ownerNum;

    private String ownerGroupNum;

    @NotBlank(message = "用户名称必须输入")
    private String ownerName;

    @NotBlank(message = "用户联系方式必须输入")
    @Pattern(regexp="[1][3|4|5|7|8][0-9]{9}",message="手机号码格式不正确")
    private String ownerPhone;

    private String ownerProvince;

    private String ownerCity;

    private String ownerArea;

    @NotBlank(message = "用户地址必须输入")
    private String ownerAddr;

    private String ownerIdcard;

    private Integer ownerSexual;

    private String ownerBirthday;

    private String ownerIdcardAddr;

    private String ownerInsTime;

    private String ownerUpdateTime;

    private Integer ownerIsDelete;

    @NotBlank(message = "用户坐标（维度）必须输入")
    private String ownerLat;

    @NotBlank(message = "用户坐标（经度）必须输入")
    private String ownerLng;
    
    private String ownerOpenid;
    
    private Integer ownerIsSender;
    
    public  OwnerDto openId(String openId) {
    	this.ownerOpenid = openId;
    	return this;
	}
  
	public Integer getOwnerIsSender() {
		return ownerIsSender;
	}

	public void setOwnerIsSender(Integer ownerIsSender) {
		this.ownerIsSender = ownerIsSender;
	}

	public OwnerDto(String ownerNum, String ownerName, String ownerPhone, String ownerProvince, String ownerCity,
			String ownerArea, String ownerAddr,  String ownerInsTime,String openId,String lat,String lng) {
		super();
		this.ownerNum = ownerNum;
		this.ownerName = ownerName;
		this.ownerPhone = ownerPhone;
		this.ownerProvince = ownerProvince;
		this.ownerCity = ownerCity;
		this.ownerArea = ownerArea;
		this.ownerAddr = ownerAddr;
		this.ownerInsTime = ownerInsTime;
		this.ownerOpenid = openId;
		this.ownerLat = lat;
		this.ownerLng = lng;
	}
	
	public OwnerDto() {}

	public OwnerDto(Integer isSender,String openId) {
		this.ownerIsSender = isSender;
		this.ownerOpenid = openId;
	}


	public String getOwnerOpenid() {
		return ownerOpenid;
	}

	public void setOwnerOpenid(String ownerOpenid) {
		this.ownerOpenid = ownerOpenid;
	}

	public Long getOwnerId() {
		return ownerId;
	}

	public void setOwnerId(Long ownerId) {
		this.ownerId = ownerId;
	}

	public String getOwnerNum() {
		return ownerNum;
	}

	public void setOwnerNum(String ownerNum) {
		this.ownerNum = ownerNum;
	}

	public String getOwnerGroupNum() {
		return ownerGroupNum;
	}

	public void setOwnerGroupNum(String ownerGroupNum) {
		this.ownerGroupNum = ownerGroupNum;
	}

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	public String getOwnerPhone() {
		return ownerPhone;
	}

	public void setOwnerPhone(String ownerPhone) {
		this.ownerPhone = ownerPhone;
	}

	public String getOwnerProvince() {
		return ownerProvince;
	}

	public void setOwnerProvince(String ownerProvince) {
		this.ownerProvince = ownerProvince;
	}

	public String getOwnerCity() {
		return ownerCity;
	}

	public void setOwnerCity(String ownerCity) {
		this.ownerCity = ownerCity;
	}

	public String getOwnerArea() {
		return ownerArea;
	}

	public void setOwnerArea(String ownerArea) {
		this.ownerArea = ownerArea;
	}

	public String getOwnerAddr() {
		return ownerAddr;
	}

	public void setOwnerAddr(String ownerAddr) {
		this.ownerAddr = ownerAddr;
	}

	public String getOwnerIdcard() {
		return ownerIdcard;
	}

	public void setOwnerIdcard(String ownerIdcard) {
		this.ownerIdcard = ownerIdcard;
	}

	public Integer getOwnerSexual() {
		return ownerSexual;
	}

	public void setOwnerSexual(Integer ownerSexual) {
		this.ownerSexual = ownerSexual;
	}

	public String getOwnerBirthday() {
		return ownerBirthday;
	}

	public void setOwnerBirthday(String ownerBirthday) {
		this.ownerBirthday = ownerBirthday;
	}

	public String getOwnerIdcardAddr() {
		return ownerIdcardAddr;
	}

	public void setOwnerIdcardAddr(String ownerIdcardAddr) {
		this.ownerIdcardAddr = ownerIdcardAddr;
	}

	public String getOwnerInsTime() {
		return ownerInsTime;
	}

	public void setOwnerInsTime(String ownerInsTime) {
		this.ownerInsTime = ownerInsTime;
	}

	public String getOwnerUpdateTime() {
		return ownerUpdateTime;
	}

	public void setOwnerUpdateTime(String ownerUpdateTime) {
		this.ownerUpdateTime = ownerUpdateTime;
	}

	public Integer getOwnerIsDelete() {
		return ownerIsDelete;
	}

	public void setOwnerIsDelete(Integer ownerIsDelete) {
		this.ownerIsDelete = ownerIsDelete;
	}

	public String getOwnerLat() {
		return ownerLat;
	}

	public void setOwnerLat(String ownerLat) {
		this.ownerLat = ownerLat;
	}

	public String getOwnerLng() {
		return ownerLng;
	}

	public void setOwnerLng(String ownerLng) {
		this.ownerLng = ownerLng;
	}

	@Override
	public String toString() {
		return "OwnerDto [ownerId=" + ownerId + ", ownerNum=" + ownerNum + ", ownerGroupNum=" + ownerGroupNum
				+ ", ownerName=" + ownerName + ", ownerPhone=" + ownerPhone + ", ownerProvince=" + ownerProvince
				+ ", ownerCity=" + ownerCity + ", ownerArea=" + ownerArea + ", ownerAddr=" + ownerAddr
				+ ", ownerIdcard=" + ownerIdcard + ", ownerSexual=" + ownerSexual + ", ownerBirthday=" + ownerBirthday
				+ ", ownerIdcardAddr=" + ownerIdcardAddr + ", ownerInsTime=" + ownerInsTime + ", ownerUpdateTime="
				+ ownerUpdateTime + ", ownerIsDelete=" + ownerIsDelete + ", ownerLat=" + ownerLat + ", ownerLng="
				+ ownerLng + "]";
	}

	public OwnerDto insTime() {
		this.ownerInsTime = DateUtils.getCurDttStr();
		return this;
	}
	public OwnerDto no(){
		this.ownerNum = TokenUtils.getNo(GenerateNumConstants.OWNER);
		return this;
	}

	public OwnerDto id(Long ownerId) {
		this.ownerId = ownerId;
		return this;
	}
	
	public OwnerDto isSender(Integer isSender){
		this.ownerIsSender = isSender;
		return this;
	}
}
